# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Eli Schwartz <eschwartz@archlinux.org>
# Contributor: Daniel Perez <tuvistavie@gmail.com>
# Contributor: AGWA
# Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>
# Contributor: noirbizarre <noirbizarre@gmail.com>
# Contributor: Wael Nasreddine <wael.nasreddine@gmail.com>

pkgname=git-crypt
pkgver=0.7.0
pkgrel=2
pkgdesc='Transparent file encryption in Git'
arch=(loong64 x86_64)
url="https://www.agwa.name/projects/$pkgname"
license=(GPL3)
depends=(git openssl)
makedepends=(libxslt docbook-xsl)
_archive="$pkgname-$pkgver"
# Upstream has temporarily lost access to PGP keys, see:
# https://github.com/AGWA/git-crypt/issues/245
source=("$url/downloads/$_archive.tar.gz" #{,.asc}
        openssl-3.0.patch)
sha256sums=('50f100816a636a682404703b6c23a459e4d30248b2886a5cf571b0d52527c7d8'
            'b8dc43540bfd80993359890a6064ef51a932d9e677b3cd62527c6cff4bdfc1f4')
            # 'SKIP')
# validpgpkeys=('EF5D84C1838F2EB6D8968C0410378EFC2080080C') # Andrew Ayer <agwa@andrewayer.name>

prepare() {
	cd "$_archive"

	# https://github.com/AGWA/git-crypt/pull/249
	patch -Np1 -i ../openssl-3.0.patch
}

build() {
	cd "$_archive"
	make ENABLE_MAN=yes PREFIX=/usr \
	  DOCBOOK_XSL=/usr/share/xml/docbook/xsl-stylesheets-*/manpages/docbook.xsl
}

package() {
	cd "$_archive"
	make ENABLE_MAN=yes PREFIX=/usr DESTDIR="$pkgdir" install
}
